import { createApp } from "vue";
import App from './App.vue';
import 'vant/lib/index.css';
import {
  Tabbar,
  TabbarItem,
  NoticeBar,
  Popup,
  Toast,
  Icon,
  Overlay,
} from 'vant';

import { createI18n } from "vue-i18n";
import messages from "./locale"; // 导入国际化语言包
import { createPinia } from 'pinia'; //导入pinia
const i18n = createI18n({
  legacy: false, // 组合式api必须设置为false：官网说明:https://vue-i18n.intlify.dev/guide/advanced/composition.html
  locale: localStorage.getItem('lang') || "en",
  fallbackLocale: "en",
  messages,
});
const app = createApp(App);
// 创建Pinia实例, 将pinia实例挂载到vue实例上
// 大菠萝配置
const pinia = createPinia();
// pinia.use(piniaPluginPersistedstate);
app.use(pinia);
app.use(i18n)
app
  .use(Tabbar)
  .use(TabbarItem)
  .use(NoticeBar)
  .use(Popup)
  .use(Toast)
  .use(Icon)
  .use(Overlay)
  .mount("#app");


